import request from '@/utils/request';

/**
 * 查询客户端管理分页
 * @param query
 * @returns {*}
 */

export const pageApiSettings = (query) => {
  return request({
    url: '/system/apiSettings/page',
    method: 'get',
    params: query
  });
};

/**
 * 查询客户端管理列表
 * @param query
 * @returns {*}
 */

export const listApiSettings = (query) => {
	return request({
		url: '/system/apiSettings/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询客户端管理详细
 * @param id
 */
export const getApiSettings = (id) => {
  return request({
    url: '/system/apiSettings/' + id,
    method: 'get'
  });
};

/**
 * 查询客户端管理详细
 * @param {String} clientId 客户端ID
 * @param {String} type 接口类型 
 * @returns 
 */
export const queryApiSettings = (clientId,type) => {
  return request({
    url: '/system/apiSettings/query',
    method: 'get',
    params: {clientId,type}
  });
};


/**
 * 新增客户端管理
 * @param data
 */
export const addApiSettings = (data) => {
  return request({
    url: '/system/apiSettings',
    method: 'post',
    data: data
  });
};

/**
 * 修改客户端管理
 * @param data
 */
export const updateApiSettings = (data) => {
  return request({
    url: '/system/apiSettings',
    method: 'put',
    data: data
  });
};

/**
 * 保存客户端管理
 * @param data
 */
export const saveOrUpdateApiSettings = (data) => {
	return request({
		url: '/system/apiSettings/save',
    headers: {
      isEncrypt: true
    },
		method: 'post',
		data: data
	});
};